﻿@model KCMS.Web.Models.FeedbackViewModel
           <script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
<h2>
    Обратная связь</h2>
@using (Ajax.BeginForm("Show", null, new AjaxOptions { HttpMethod = "POST", OnComplete = "showMsg" }, new { @id = "feedback-form" }))
{
       
    <div class="feedback-subtitle">
        Ваше имя*:</div>
    <div class="feedback-subinfo">
        @Html.TextBoxFor(model=>model.Title)
         @Html.ValidationMessageFor(model => model.Title)
    </div>
    <div class="feedback-subtitle">
        Еmail*:</div>
    
    <div class="feedback-subinfo">
        @Html.TextBoxFor(model => model.Email)
         @Html.ValidationMessageFor(model => model.Email)
    </div>
    <div class="feedback-subtitle">
        Тема*:
    </div>
    
    <div class="feedback-subinfo">
        @Html.TextBoxFor(model => model.Subtitle)
         @Html.ValidationMessageFor(model => model.Subtitle)
    </div>
    <div class="feedback-subtitle">
        Текст сообщения*:
    </div>
    
    <div class="feedback-subinfo">
        @Html.TextAreaFor(model=>model.Body,24, 50,null)
         @Html.ValidationMessageFor(model => model.Body)
    </div>
    <div class="rigth-align">
        <input type="submit" class="button" value="Отправить" />
    </div>
}
<script type="text/javascript">
    function showMsg(data) {
        var json = $.parseJSON(data.responseText);
        alert(json.message);
    }
</script>
